import request from "@/utils/request.js";

/**
 * 分页查询应用浏览量
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const queryAppBrowsePage = (data) => {
  return request.post("/admin/app/browse/page", data);
};

/**
 * 导出应用浏览量表格信息
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const exportAppBrowseToExcel = (data) => {
  return request.post("/admin/app/browse/export", data, {
    responseType: "blob",
  });
};

/**
 * 删除应用浏览量数据
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const deleteAppBrowse = (data) => {
  return request.delete("/admin/app/browse", { data });
};

// 新增获取今日应用浏览量统计数据的接口请求函数
export const getTodayHotApp = () => {
  return request.get("/admin/app/browse/today");
};

// 新增删除指定应用浏览记录的接口请求函数
export const deleteAppBrowseById = (id) => {
  return request.delete(`/admin/app/browse/${id}`);
};
